﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DnPakExplorer.Forms {
	public partial class DntableSearchForm : Form {
		DntExplorer mDntform;

		public DntableSearchForm(DntExplorer form) {
			mDntform = form;
			InitializeComponent();
		}

		private void DntableSearchForm_Load(object sender, EventArgs e) {
			
		}

		public void SetCollumns(string[] collumns, int selectedIndex) {
			comboBox1.Items.AddRange(collumns);
			comboBox1.SelectedIndex =selectedIndex;
		}

		private void textBox1_KeyUp(object sender, KeyEventArgs e) {
			//if (downKey == e.KeyCode && e.KeyCode == Keys.Enter && textBox1.Focused) {
			//	mDntform.Search(textBox1.Text, comboBox1.SelectedIndex);
			//}
		}

		Keys downKey;
		private void textBox1_KeyDown(object sender, KeyEventArgs e) {
			downKey = e.KeyCode;
		}

		private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) {
			if (e.KeyCode == Keys.Enter && textBox1.Text!="") {
				mDntform.Search(textBox1.Text, comboBox1.SelectedIndex);
			}
		}

	}
}
